A5WS_Get_User_Values Function

This function is deprecated and this page will be removed in the near future. Use A5WS_Get_WebUser_Values().

Syntax

Result as P = a5ws_Get_User_Values(P CurrentForm [,* request ])

Arguments

Result

The result value is not meaningful if the function is being used in a web component.

result.errors = Will return TRUE if any errors are found during processing.
result.error_text = Error messages returned.
CurrentForm

The CurrentForm variable.

request

The Request system variable. This variable explicitly passes all request variables to the function. Users are found by three possible values passed in the request.variables property of the request variable. There are checked in sequence until a match is found.

request.variables.guid = The user GUID value for the desired user record
request.variables.userid = The 'userid' value for the desired user record
request.variables.ulink = The 'ulink' value saved in the desired user record
A5WS_Get_WebUser_Values() should be used instead."/>

Description

This function is deprecated and this page will be removed in the near future. The function A5WS_Get_WebUser_Values() should be used instead.

Discussion

This function is deprecated and this page will be removed in the near future. The function A5WS_Get_WebUser_Values() should be used instead.

The A5WS_Get_User_Values() function populates control values in a dialog component from fields in the User table. The function returns values from web user table as CurrentForm.Controls..value for each field in table. Accepts user identification as request.variables.guid, request.variables.userid or request.variables.ulink.

The name of each control in the dialog must exactly match the name of the field in the user table. A list of valid field names can be found by using the A5WS_User_File_Field_List() function. Typically used in the Server Initialize event of a dialog component. You can also use this function in the Server After Validate event to repopulate values after a save. Adding Users with a Web Component shows how the function is used in dialog component events.

  1. Display the Form > Properties menu page of the Dialog Builder.

  2. Click in the Server Events > Initialize property.

Example

a5ws_get_user_values(CurrentForm,request)

Using the Function Outside of a Dialog Component

The function is designed to be used within Server Events of a dialog component. However, it can be used on any Xbasic code section on a web page or component to return various values for a specific user. It is helpful to get a list of valid field names currently being used in the user security table by using the A5WS_User_File_Field_List() function. One additional field named groups can be returned. It will contain a comma delimited list of the security groups assigned to the user. The group values returned will be the group_guid value for each group, not the group names. A list of group names assigned to the user can be found using the function A5WS_Get_User_Assignments.

? a5ws_User_File_Field_List()
= Email
Guid
Password
Ulink
Userid

The fields to be output from the function must be defined. The function will only return values for field names passed to the function as .Controls..value and will only return values for fields currently being used by the security system.

dim output as p
dim output.controls as p
dim output.controls.email.value as c
dim output.controls.userid.value as c
dim output.controls.groups.value as c
dim output.controls.guid.value as c

A value must be passed to the function in the Request system variable to find the current user. This can be in the form request.variables.guid, request.variables.userid or request.variables.ulink.

dim request.variables.ulink as c
request.variables.ulink = "00000008"

The function will return the values found in the output.controls..value. The result.errors value can be tested to determine if any errors occurred during processing. Any error messages will be should in the result.error_text value. The userid value can be used to get a list of group names for the user using the function A5WS_Get_User_Assignments.

dim result as p
dim error_message as c
dim group_list as c
result = a5ws_Get_User_Values(output,request)
if result.errors = .T. then
    error_message = result.error_text
    end
end if 
group_list = a5ws_get_user_assignments(output.controls.userid.value,request)
group_list = crlf_to_comma(group_list)

Limitations

DEPRECATED

See Also